// 引入 react 依赖
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Text, View, Image, TouchableOpacity, ImageBackground, ScrollView, TextInput, InteractionManager, BackHandler } from 'react-native';

// 引入第三方依赖
import _ from 'lodash';
import pureRender from 'pure-render-decorator';
import Icon from 'react-native-vector-icons/dist/Ionicons';
import { Actions } from 'react-native-router-flux';

// antd 按需加载
import { Portal, Toast, List, Radio, Modal } from '@ant-design/react-native';
const Item = List.Item;
const Brief = Item.Brief;
const RadioItem = Radio.RadioItem;

// 引入 处理数据 所需文件
import { generateOrder, generateBehalfOrder, addOrder, pay } from './module/module.js'

// 引入样式
import Style from './style/style.js';

// 引入公用组件
import { Status, NavBar, Title, HomeIndicator, IsPay } from '../../components/index.js'

// 引入专用组件
import { } from './components'

// 引入工具包
import { press, size, longitude, latitude, ScreenWidth, wxPay } from '../../util/utils.js'

class PayAtm extends Component {

  constructor(props) {
    super(props)
    this.state = {
    }
  }

  componentDidMount() {
    this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
  }

  handleBackPress = () => {
    Actions.orderInfo({ id: this.props.orderNo.id })
    // Actions.pop({ refresh: { isRefresh: true }, timeout: 1 })
    return true
  }

  render() {
    const { confirmOrder, confirmOrderPay, magazineOrder, bookOrder, order, price, orderPayType } = this.props
    const { payVisible, data, money, preferential, payType, html, payInfo } = this.state
    return (
      <View style={Style.container}>
        <Status />
        <NavBar
          title="支付"
          back={this.handleBackPress}
        />
        <ScrollView
          style={[Style.content, {
          }]}
        >
          <View style={{ padding: 15 }}>
            <Text style={{ fontSize: 18, color: '#61676F', lineHeight: 24, marginBottom: 10 }}>ATM 转账，请转账至以下账户</Text>
            <Text style={{ fontSize: 14, color: '#61676F', lineHeight: 16, }}>转入户口名称：LZ HANX SDN BHD</Text>
            <Text style={{ fontSize: 14, color: '#61676F', lineHeight: 16, }}>Public Bank: 3155-013-230</Text>
            <Text style={{ fontSize: 14, color: '#61676F', lineHeight: 16, }}>Maybank: 5141-6962-2957</Text>
          </View>
        </ScrollView>
        <TouchableOpacity
          style={{
            paddingVertical: 14,
            paddingHorizontal: 20,
            backgroundColor: '#f23030',
            alignItems: 'center',
            justifyContent: 'center',
          }}
          onPress={() => {
            Actions.orderInfo({ id: this.props.orderNo.id })
          }}
        >
          <Text style={{ fontSize: 16, color: '#fff', lineHeight: 18, }}>查看订单</Text>
        </TouchableOpacity>
      </View>
    )
  }
}


export default connect(({ }) => ({
}))(pureRender(PayAtm))
